﻿@{
    Layout = null;
}

@using Domain.Entities;

<div class="bjui-pageContent">
    <form action="WikiEdit" id="Wiki_edit" data-toggle="validate" data-alertmsg="false" autocomplete="off">
        <table class="table table-condensed table-hover" width="100%">
            <tbody>
                @if (Model != null)
                {
                    <tr>
                        <td>
                            <input type="hidden" id="Id" name="Id" value="@Model.Id" />
                            <label class="control-label x100">标题：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Article_name" id="Article_name" data-rule="文章标题:required" maxlength="20" value="@Model.Article_name" size="25" placeholder="[必填] 文章标题">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">关键字：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Article_key" id="Article_key"  maxlength="20" value="@Model.Article_key" size="15" placeholder="">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">类型：</label>
                        </td>
                        <td>
                            <input type="hidden" id="ArticleType_Id" name="ArticleType_Id" value="@Model.ArticleType_Id" />
                            <input type="text" name="ArticleType_name" id="ArticleType_name" value="****" data-rule="类型:required" readonly placeholder="[必填] 类型" data-toggle="findgrid" 
                       data-options="{
                        group: '',
                        include: 'ArticleType_Id:ArticleType_id,ArticleType_name',
                        dialogOptions: {title:'选择类型'},
                        gridOptions: {
                            local: 'local',
                            dataUrl: 'Wiki/SearchType',
                            columns: [
                                {name:'ArticleType_id', label:'ID', width:100},
                                {name:'ArticleType_name', label:'类型'}
                            ]
                        }
                    }">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">内容：</label>
                        </td>
                        <td>
                            <textarea data-toggle="kindeditor" name="Article_txt" id="Article_txt" style="width: 700px;" data-minheight="200">@Model.Article_txt</textarea>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">状态：</label>
                        </td>
                        <td>
                            @if (Model.Disable == 1)
                            {
                                <input runat="server" type="checkbox" id="Disable" name="Disable" value="1" checked data-toggle="icheck" data-label="正常">
                            }
                            else
                            {
                                <input runat="server" type="checkbox" id="Disable" name="Disable" value="1" data-toggle="icheck" data-label="正常">
                            }
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">备注：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Disabledesc" id="Disabledesc" maxlength="15" value="@Model.Disabledesc" size="20" placeholder="备注">
                        </td>
                    </tr>
                }
                else
                {
                    <tr>
                        <td>
                            <label class="control-label x100">标题：</label>
                        </td>
                        <td>
                            <input type="hidden" id="Id" name="Id" value="0" />
                            <input type="text" runat="server" name="Article_name" id="Article_name" data-rule="文章标题:required" maxlength="50" value="" size="25" placeholder="[必填] 文章标题">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">关键字：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Article_Key" id="Article_Key" maxlength="15" value="" size="20" placeholder="">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">类型：</label>
                        </td>
                        <td>
                            <input type="hidden" id="ArticleType_Id" name="ArticleType_Id" value="" />
                            <input type="text" name="ArticleType_name" id="ArticleType_name" value="" data-rule="类型:required" readonly placeholder="[必填] 类型" data-toggle="findgrid"
                                   data-options="{
                        group: '',
                        include: 'ArticleType_Id:ArticleType_id,ArticleType_name',
                        dialogOptions: {title:'选择类型'},
                        gridOptions: {
                            local: 'local',
                            dataUrl: 'Wiki/SearchType',
                            columns: [
                                {name:'ArticleType_id', label:'ID', width:100},
                                {name:'ArticleType_name', label:'类型'}
                            ]
                        }
                    }">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">内容：</label>
                        </td>
                        <td>
                            <textarea data-toggle="kindeditor" name="Article_txt" id="Article_txt"  style="width: 700px;"  data-minheight="200"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">状态：</label>
                        </td>
                        <td>
                            <input runat="server" type="checkbox" id="Disable" name="Disable" value="1" checked data-toggle="icheck" data-label="正常">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label class="control-label x100">备注：</label>
                        </td>
                        <td>
                            <input type="text" runat="server" name="Disabledesc" id="Disabledesc" maxlength="15" value="" size="20" placeholder="备注">
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-close" data-icon="close">取消</button></li>
        <li><button type="submit" class="btn-green" data-icon="save">提交</button></li>
    </ul>
</div>
<script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    KindEditor.ready(function (K) {
        window.editor = K.create('#Article_txt', {
            uploadJson: '/wiki/KindeditorPicUpload',
            fileManagerJson: '/wiki/KindeditorPicUpload',
            allowFileManager: true
        });
    });
</script>


